home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / What's New? / Tool Chest / Text / WASTE 1.2a6 / WASTE C⁄C++ Headers / WASTE.h < prev   
Encoding:
C/C++ Source or Header  |  1996-04-22  |  33.7 KB  |  780 lines  |  [TEXT/CWIE]

  1. /*
  2.  *    WASTE.h
  3.  *
  4.  *    C/C++ interface to the WASTE text engine
  5.  *
  6.  *    version 1.2a6 (April 1996)
  7.  *
  8.  *    Copyright (c) 1993-1996 Marco Piovanelli
  9.  *    All Rights Reserved
  10.  * 
  11.  */
  12.  
  13. #ifndef _WASTE_
  14. #define _WASTE_
  15.  
  16. #ifndef __CONDITIONALMACROS__
  17. #include <ConditionalMacros.h>
  18. #endif
  19.  
  20. #ifndef __TYPES__
  21. #include <Types.h>
  22. #endif
  23.  
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27.  
  28. #ifndef __QUICKDRAWTEXT__
  29. #include <QuickdrawText.h>
  30. #endif
  31.  
  32. #ifndef __QUICKDRAW__
  33. #include <Quickdraw.h>
  34. #endif
  35.  
  36. #ifndef __SCRIPT__
  37. #include <Script.h>
  38. #endif
  39.  
  40. #ifndef __TEXTUTILS__
  41. #include <TextUtils.h>
  42. #endif
  43.  
  44. #ifndef __TEXTEDIT__
  45. #include <TextEdit.h>
  46. #endif
  47.  
  48. #ifndef __DRAG__
  49. #include <Drag.h>
  50. #endif
  51.  
  52. #ifndef __LONGCOORDINATES__
  53. #ifndef _LongCoords_
  54. #include "LongCoords.h"
  55. #endif
  56. #endif
  57.  
  58. // if we're using a pre-2.1 version of the Universal Headers, define EventModifiers
  59. #ifndef UNIVERSAL_INTERFACES_VERSION
  60. typedef unsigned short EventModifiers;
  61. #endif
  62.  
  63. #if defined(powerc) || defined (__powerc)
  64. #pragma options align=mac68k
  65. #endif
  66.  
  67. //    The macro WASTE_VERSION expands to the current version of WASTE,
  68. //    expressed in standard NumVersion format (see Types.h)
  69. //    The macro WASTE11 is obsolete but still supported for backward
  70. //    compatibility
  71.  
  72. #define WASTE_VERSION    0x01204006
  73. #define WASTE11
  74.  
  75. /*    result codes */
  76.  
  77. enum {
  78.     weCantUndoErr            =    -10015,    /* undo buffer is clear (= errAECantUndo) */
  79.     weEmptySelectionErr        =    -10013,    /* selection range is empty (= errAENoUserSelection) */
  80.     weNotHandledErr            =    -1708,    /* please use default behavior (= errAEEventNotHandled) */
  81.     weUnknownObjectTypeErr    =    -9478,    /* specified object type is not registered */
  82.     weObjectNotFoundErr        =    -9477,    /* no object found at specified offset */
  83.     weReadOnlyErr            =    -9476,    /* instance is read-only */
  84.     weUndefinedSelectorErr    =    -50        /* unknown selector (= paramErr) */
  85. };
  86.  
  87. /*    alignment styles */
  88.  
  89. enum {
  90.     weFlushLeft         =    -2,        /* flush left */
  91.     weFlushRight        =    -1,        /* flush right */
  92.     weFlushDefault        =     0,        /* flush according to system direction */
  93.     weCenter            =     1,        /* centered */
  94.     weJustify            =     2        /* fully justified */
  95. };
  96.  
  97. /*    values for the mode parameter in WESetStyle and WEContinuousStyle */
  98.  
  99. enum {
  100.     weDoFont                =    0x0001,
  101.     weDoFace                =    0x0002,
  102.     weDoSize                =    0x0004,
  103.     weDoColor                =    0x0008,
  104.     weDoAll                    =    weDoFont + weDoFace + weDoSize + weDoColor,
  105.     weDoAddSize                =    0x0010,
  106.     weDoToggleFace            =    0x0020,
  107.     weDoReplaceFace            =    0x0040,
  108.     weDoPreserveScript        =    0x0080,
  109.     weDoExtractSubscript    =    0x0100,
  110.     weDoFaceMask            =    0x0200
  111. };
  112.  
  113. /*    values for the edge parameter in WEGetOffset etc. */
  114.  
  115. enum {
  116.     kLeadingEdge = -1,        /* point is on the leading edge of a glyph */
  117.     kTrailingEdge = 0,        /* point is on the trailing edge of a glyph */
  118.     kObjectEdge = 2            /* point is in the middle of an embedded object */
  119. };
  120.  
  121. /*    values for WEFeatureFlag feature parameter */
  122.  
  123. enum {
  124.     weFAutoScroll        =    0,        /* automatically scroll the selection range into view */
  125.     weFOutlineHilite    =    2,        /* frame selection when deactivated */
  126.     weFReadOnly            =    5,        /* disallow modifications */
  127.     weFUndo                =    6,        /* support WEUndo() */
  128.     weFIntCutAndPaste    =    7,        /* use intelligent cut-and-paste rules */
  129.     weFDragAndDrop        =    8,        /* support drag-and-drop text editing */
  130.     weFInhibitRecal        =    9,        /* don't recalculate line starts and don't redraw text */
  131.     weFUseTempMem        =    10,        /* use temporary memory for main data structures */
  132.     weFDrawOffscreen    =    11,        /* draw text offscreen for smoother visual results */
  133.     weFInhibitRedraw    =    12,        /* don't redraw text */
  134.     weFMonoStyled        =    13,        /* disallow style changes */
  135.     weFInhibitColor        =    31        /* draw in black & white only */
  136. };
  137.  
  138. /*    values for WENew flags parameter */
  139.  
  140. enum {
  141.     weDoAutoScroll        =    1L << weFAutoScroll,
  142.     weDoOutlineHilite    =    1L << weFOutlineHilite,
  143.     weDoReadOnly        =    1L << weFReadOnly,
  144.     weDoUndo            =    1L << weFUndo,
  145.     weDoIntCutAndPaste    =    1L << weFIntCutAndPaste,
  146.     weDoDragAndDrop        =    1L << weFDragAndDrop,
  147.     weDoInhibitRecal    =    1L << weFInhibitRecal,
  148.     weDoUseTempMem        =    1L << weFUseTempMem,
  149.     weDoDrawOffscreen    =    1L << weFDrawOffscreen,
  150.     weDoInhibitRedraw    =    1L << weFInhibitRedraw,
  151.     weDoMonoStyled        =    1L << weFMonoStyled,
  152.     weDoInhibitColor    =    1L << weFInhibitColor
  153. };
  154.  
  155. /*    values for WEFeatureFlag action parameter */
  156.  
  157. enum {
  158.     weBitToggle = -2,    /* toggles the specified feature */
  159.     weBitTest,            /* returns the current setting of the specified feature */
  160.     weBitClear,            /* disables the specified feature */
  161.     weBitSet            /* enables the specified feature */
  162. };
  163.  
  164. /*    selectors for WEGetInfo and WESetInfo */
  165.  
  166. enum {
  167.     weCharByteHook            =    'cbyt', /* CharByte hook */
  168.     weCharToPixelHook        =    'c2p ',    /* CharToPixel hook */
  169.     weCharTypeHook            =    'ctyp', /* CharType hook */
  170.     weClickLoop                =    'clik',    /* click loop callback */
  171.     weCurrentDrag            =    'drag',    /* drag currently being tracked from WEClick() */
  172.     weDrawTextHook            =    'draw', /* text drawing hook */
  173.     weHiliteDropAreaHook    =    'hidr', /* drop area highlighting hook */
  174.     weLineBreakHook            =    'lbrk',    /* line breaking hook */
  175.     wePixelToCharHook        =    'p2c ', /* PixelToChar hook */
  176.     wePort                    =    'port',    /* graphics port */
  177.     weRefCon                =    'refc',    /* reference constant for use by application */
  178.     weScrollProc            =    'scrl',    /* auto-scroll callback */
  179.     weText                    =    'text',    /* text handle */
  180.     weTranslateDragHook     =    'xdrg', /* drag translation callback */
  181.     weTSMDocumentID            =    'tsmd',    /* Text Services Manager document ID */
  182.     weTSMPreUpdate            =    'pre ',    /* Text Services Manager pre-update callback */
  183.     weTSMPostUpdate            =    'post',    /* Text Services Manager post-update callback */
  184.     weURLHint                =    'urlh',    /* URL hint string for Internet Config */
  185.     weWordBreakHook            =    'wbrk'    /* word breaking hook */
  186. };
  187.  
  188. /*    values for WEInstallObjectHandler handlerSelector parameter */
  189.  
  190. enum {
  191.     weNewHandler        =    'new ',        /* new handler */
  192.     weDisposeHandler    =    'free',        /* dispose handler */
  193.     weDrawHandler        =    'draw',        /* draw handler */
  194.     weClickHandler        =    'clik',        /* click handler */
  195.     weStreamHandler        =    'strm'        /* stream handler */
  196. };
  197.  
  198. /*    action kinds */
  199.  
  200. enum {
  201.     weAKNone            =    0,        /* null action */
  202.     weAKUnspecified        =    1,        /* action of unspecified nature */
  203.     weAKTyping            =    2,        /* some text has been typed in */
  204.     weAKCut                =    3,        /* the selection range has been cut */
  205.     weAKPaste            =    4,        /* something has been pasted */
  206.     weAKClear            =    5,        /* the selection range has been deleted */
  207.     weAKDrag            =    6,        /* drag and drop operation */
  208.     weAKSetStyle        =    7        /* some style has been applied to a text range */
  209. };
  210.  
  211. /*    destination kinds for stream handler */
  212.  
  213. enum {
  214.     weToScrap            =    0,
  215.     weToDrag            =    1,
  216.     weToSoup            =    2
  217. };
  218.  
  219. typedef struct OpaqueWEReference *WEReference;
  220. typedef struct OpaqueWEObjectReference *WEObjectReference;
  221. typedef Handle WESoupHandle;
  222. typedef short WEActionKind;
  223. typedef char WEAlignment;
  224. typedef unsigned short WEStyleMode;
  225. typedef FourCharCode WESelector;
  226. typedef WEReference WEHandle;    /* obsolete, kept for backward compatibility */
  227.  
  228. typedef struct WERunInfo {
  229.     long                 runStart;    /* byte offset to first character of style run */
  230.     long                 runEnd;        /* byte offset past last character of style run */
  231.     short                 runHeight;    /* line height (ascent + descent + leading) */
  232.     short                 runAscent;    /* font ascent */
  233.     TextStyle             runStyle;    /* text attributes */
  234.     WEObjectReference    runObject;    /* either nil or reference to embedded object */
  235. } WERunInfo;
  236.  
  237.  
  238. /*    callback prototypes */
  239.  
  240. typedef pascal Boolean (*WEClickLoopProcPtr)(WEReference we);
  241. typedef pascal void (*WEScrollProcPtr)(WEReference we);
  242. typedef pascal void (*WETSMPreUpdateProcPtr)(WEReference we);
  243. typedef pascal void (*WETSMPostUpdateProcPtr)(WEReference we,
  244.         long fixLength, long inputAreaStart, long inputAreaEnd,
  245.         long pinRangeStart, long pinRangeEnd);
  246. typedef pascal OSErr (*WETranslateDragProcPtr)(DragReference theDrag,
  247.         ItemReference theItem, FlavorType requestedType, Handle putDataHere);
  248. typedef pascal OSErr (*WEHiliteDropAreaProcPtr)(DragReference theDrag,
  249.         Boolean hiliteFlag, WEReference we);
  250. typedef pascal void (*WEDrawTextProcPtr)(Ptr pText, long textLength, Fixed slop,
  251.         JustStyleCode styleRunPosition, WEReference we);
  252. typedef pascal long (*WEPixelToCharProcPtr)(Ptr pText, long textLength, Fixed slop,
  253.         Fixed *pixelWidth, char *edge, JustStyleCode styleRunPosition, Fixed hPos, WEReference we);
  254. typedef pascal short (*WECharToPixelProcPtr)(Ptr pText, long textLength, Fixed slop,
  255.         long offset, short direction, JustStyleCode styleRunPosition, long hPos, WEReference we);
  256. typedef pascal StyledLineBreakCode (*WELineBreakProcPtr)(Ptr pText, long textLength,
  257.         long textStart, long textEnd, Fixed *textWidth, long *textOffset, WEReference we);
  258. typedef pascal void (*WEWordBreakProcPtr)(Ptr pText, short textLength, short offset,
  259.         char edge, OffsetTable breakOffsets, ScriptCode script, WEReference we);
  260. typedef pascal short (*WECharByteProcPtr)(Ptr pText, short textOffset, ScriptCode script,
  261.         WEReference we);
  262. typedef pascal short (*WECharTypeProcPtr)(Ptr pText, short textOffset, ScriptCode script, WEReference we);
  263. typedef pascal OSErr (*WENewObjectProcPtr)(Point *defaultObjectSize,
  264.         WEObjectReference obj);
  265. typedef pascal OSErr (*WEDisposeObjectProcPtr)(WEObjectReference obj);
  266. typedef pascal OSErr (*WEDrawObjectProcPtr)(const Rect *destRect,
  267.         WEObjectReference obj);
  268. typedef pascal Boolean (*WEClickObjectProcPtr)(Point hitPt, EventModifiers modifiers, unsigned long clickTime,
  269.         WEObjectReference obj);
  270. typedef pascal OSErr (*WEStreamObjectProcPtr)(short destKind, FlavorType *theType,
  271.         Handle putDataHere, WEObjectReference obj);
  272.  
  273.  
  274. /*    UPP proc info */
  275.  
  276. enum {
  277.     uppWEClickLoopProcInfo = kPascalStackBased
  278.         | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  279.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  280. };
  281. enum {
  282.     uppWEScrollProcInfo = kPascalStackBased
  283.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  284. };
  285. enum {
  286.     uppWETSMPreUpdateProcInfo = kPascalStackBased
  287.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  288. };
  289. enum {
  290.     uppWETSMPostUpdateProcInfo = kPascalStackBased
  291.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEReference /*we*/)))
  292.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(long /*fixLength*/)))
  293.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(long /*inputAreaStart*/)))
  294.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(long /*inputAreaEnd*/)))
  295.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(long /*pinRangeStart*/)))
  296.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(long /*pinRangeEnd*/)))
  297. };
  298. enum {
  299.     uppWETranslateDragProcInfo = kPascalStackBased
  300.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  301.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(DragReference /*theDrag*/)))
  302.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(ItemReference /*theItem*/)))
  303.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(FlavorType /*requestedType*/)))
  304.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(Handle /*putDataHere*/)))
  305. };
  306. enum {
  307.     uppWEHiliteDropAreaProcInfo = kPascalStackBased
  308.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  309.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(DragReference /*theDrag*/)))
  310.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(Boolean /*hiliteFlag*/)))
  311.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(WEReference /*we*/)))
  312. };
  313. enum {
  314.     uppWEDrawTextProcInfo = kPascalStackBased
  315.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  316.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(long /*textLength*/)))
  317.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Fixed /*slop*/)))
  318.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(JustStyleCode /*styleRunPosition*/)))
  319.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(WEReference /*we*/)))
  320. };
  321. enum {
  322.     uppWEPixelToCharProcInfo = kPascalStackBased
  323.         | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  324.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  325.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(long /*textLength*/)))
  326.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Fixed /*slop*/)))
  327.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(Fixed * /*pixelWidth*/)))
  328.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(char * /*edge*/)))
  329.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(JustStyleCode /*styleRunPosition*/)))
  330.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(Fixed /*hPos*/)))
  331.         | STACK_ROUTINE_PARAMETER(8,SIZE_CODE(sizeof(WEReference /*we*/)))
  332. };
  333. enum {
  334.     uppWECharToPixelProcInfo = kPascalStackBased
  335.         | RESULT_SIZE(SIZE_CODE(sizeof(short)))
  336.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  337.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(long /*textLength*/)))
  338.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(Fixed /*slop*/)))
  339.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(long /*offset*/)))
  340.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(short /*direction*/)))
  341.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(JustStyleCode /*styleRunPosition*/)))
  342.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(long /*hPos*/)))
  343.         | STACK_ROUTINE_PARAMETER(8,SIZE_CODE(sizeof(WEReference /*we*/)))
  344. };
  345. enum {
  346.     uppWELineBreakProcInfo = kPascalStackBased
  347.         | RESULT_SIZE(SIZE_CODE(sizeof(StyledLineBreakCode )))
  348.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  349.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(long /*textLength*/)))
  350.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(long /*textStart*/)))
  351.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(long /*textEnd*/)))
  352.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(Fixed * /*textWidth*/)))
  353.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(long * /*textOffset*/)))
  354.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(WEReference /*we*/)))
  355. };
  356. enum {
  357.     uppWEWordBreakProcInfo = kPascalStackBased
  358.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  359.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(short /*textLength*/)))
  360.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(short /*offset*/)))
  361.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(char /*edge*/)))
  362.         | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(OffsetTable * /*breakOffsets*/)))
  363.         | STACK_ROUTINE_PARAMETER(6,SIZE_CODE(sizeof(ScriptCode /*script*/)))
  364.         | STACK_ROUTINE_PARAMETER(7,SIZE_CODE(sizeof(WEReference /*we*/)))
  365. };
  366. enum {
  367.     uppWECharByteProcInfo = kPascalStackBased
  368.         | RESULT_SIZE(SIZE_CODE(sizeof(short )))
  369.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  370.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(short /*textOffset*/)))
  371.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(ScriptCode /*script*/)))
  372.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(WEReference /*we*/)))
  373. };
  374. enum {
  375.     uppWECharTypeProcInfo = kPascalStackBased
  376.         | RESULT_SIZE(SIZE_CODE(sizeof(short )))
  377.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Ptr /*pText*/)))
  378.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(short /*textOffset*/)))
  379.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(ScriptCode /*script*/)))
  380.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(WEReference /*we*/)))
  381. };
  382.  
  383.  
  384. enum {
  385.     uppWENewObjectProcInfo = kPascalStackBased
  386.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  387.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Point * /*defaultObjectSize*/)))
  388.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  389. };
  390. enum {
  391.     uppWEDisposeObjectProcInfo = kPascalStackBased
  392.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  393.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  394. };
  395. enum {
  396.     uppWEDrawObjectProcInfo = kPascalStackBased
  397.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  398.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(const Rect * /*destRect*/)))
  399.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  400. };
  401. enum {
  402.     uppWEClickObjectProcInfo = kPascalStackBased
  403.         | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  404.         | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(Point /*hitPt*/)))
  405.         | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(EventModifiers /*modifiers*/)))
  406.         | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(unsigned long /*clickTime*/)))
  407.         | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  408. };
  409. enum {
  410.     uppWEStreamObjectProcInfo = kPascalStackBased
  411.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  412.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short /*destKind*/)))
  413.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(FlavorType * /*theType*/)))
  414.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Handle /*putDataHere*/)))
  415.         | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(WEObjectReference /*obj*/)))
  416. };
  417.  
  418.  
  419. /*    UPPs, New≈Proc macros & Call≈Proc macros */
  420.  
  421. /*
  422.     NOTE:
  423.     For compatibility with the Pascal version, Call≈Proc macros take the form:
  424.  
  425.         CallFooProc(..., userRoutine)
  426.  
  427.     instead of:
  428.  
  429.         CallFooProc(userRoutine, ...)
  430.  
  431. */
  432.  
  433. #if GENERATINGCFM
  434.  
  435. typedef UniversalProcPtr WEClickLoopUPP;
  436. typedef UniversalProcPtr WEScrollUPP;
  437. typedef UniversalProcPtr WETSMPreUpdateUPP;
  438. typedef UniversalProcPtr WETSMPostUpdateUPP;
  439. typedef UniversalProcPtr WETranslateDragUPP;
  440. typedef UniversalProcPtr WEHiliteDropAreaUPP;
  441. typedef UniversalProcPtr WEDrawTextUPP;
  442. typedef UniversalProcPtr WEPixelToCharUPP;
  443. typedef UniversalProcPtr WECharToPixelUPP;
  444. typedef UniversalProcPtr WELineBreakUPP;
  445. typedef UniversalProcPtr WEWordBreakUPP;
  446. typedef UniversalProcPtr WECharByteUPP;
  447. typedef UniversalProcPtr WECharTypeUPP;
  448. typedef UniversalProcPtr WENewObjectUPP;
  449. typedef UniversalProcPtr WEDisposeObjectUPP;
  450. typedef UniversalProcPtr WEDrawObjectUPP;
  451. typedef UniversalProcPtr WEClickObjectUPP;
  452. typedef UniversalProcPtr WEStreamObjectUPP;
  453.  
  454. #define NewWEClickLoopProc(userRoutine) \
  455.     (WEClickLoopUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEClickLoopProcInfo, GetCurrentArchitecture())
  456. #define NewWEScrollProc(userRoutine) \
  457.     (WEScrollUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEScrollProcInfo, GetCurrentArchitecture())
  458. #define NewWETSMPreUpdateProc(userRoutine) \
  459.     (WETSMPreUpdateUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWETSMPreUpdateProcInfo, GetCurrentArchitecture())
  460. #define NewWETSMPostUpdateProc(userRoutine) \
  461.     (WETSMPostUpdateUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWETSMPostUpdateProcInfo, GetCurrentArchitecture())
  462. #define NewWETranslateDragProc(userRoutine) \
  463.     (WETranslateDragUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWETranslateDragProcInfo, GetCurrentArchitecture())
  464. #define NewWEHiliteDropAreaProc(userRoutine) \
  465.     (WEHiliteDropAreaUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEHiliteDropAreaProcInfo, GetCurrentArchitecture())
  466. #define NewWEDrawTextProc(userRoutine) \
  467.     (WEDrawTextUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEDrawTextProcInfo, GetCurrentArchitecture())
  468. #define NewWEPixelToCharProc(userRoutine) \
  469.     (WEPixelToCharUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEPixelToCharProcInfo, GetCurrentArchitecture())
  470. #define NewWECharToPixelProc(userRoutine) \
  471.     (WECharToPixelUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWECharToPixelProcInfo, GetCurrentArchitecture())
  472. #define NewWELineBreakProc(userRoutine) \
  473.     (WELineBreakUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWELineBreakProcInfo, GetCurrentArchitecture())
  474. #define NewWEWordBreakProc(userRoutine) \
  475.     (WEWordBreakUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEWordBreakProcInfo, GetCurrentArchitecture())
  476. #define NewWECharByteProc(userRoutine) \
  477.     (WECharByteUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWECharByteProcInfo, GetCurrentArchitecture())
  478. #define NewWECharTypeProc(userRoutine) \
  479.     (WECharTypeUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWECharTypeProcInfo, GetCurrentArchitecture())
  480. #define NewWENewObjectProc(userRoutine) \
  481.     (WENewObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWENewObjectProcInfo, GetCurrentArchitecture())
  482. #define NewWEDisposeObjectProc(userRoutine) \
  483.     (WEDisposeObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEDisposeObjectProcInfo, GetCurrentArchitecture())
  484. #define NewWEDrawObjectProc(userRoutine) \
  485.     (WEDrawObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEDrawObjectProcInfo, GetCurrentArchitecture())
  486. #define NewWEClickObjectProc(userRoutine) \
  487.     (WEClickObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEClickObjectProcInfo, GetCurrentArchitecture())
  488. #define NewWEStreamObjectProc(userRoutine) \
  489.     (WEStreamObjectUPP) NewRoutineDescriptor((ProcPtr) (userRoutine), uppWEStreamObjectProcInfo, GetCurrentArchitecture())
  490.  
  491. #define CallWEClickLoopProc(we, userRoutine) \
  492.     CallUniversalProc((userRoutine), uppWEClickLoopProcInfo, (we))
  493. #define CallWEScrollProc(we, userRoutine) \
  494.     CallUniversalProc((userRoutine), uppWEScrollProcInfo, (we))
  495. #define CallWETSMPreUpdateProc(we, userRoutine) \
  496.     CallUniversalProc((userRoutine), uppWETSMPreUpdateProcInfo, (we))
  497. #define CallWETSMPostUpdateProc(we, fixLength, inputAreaStart, inputAreaEnd, pinRangeStart, pinRangeEnd, userRoutine) \
  498.     CallUniversalProc((userRoutine), uppWETSMPostUpdateProcInfo, (we), (fixLength), (inputAreaStart), (inputAreaEnd), (pinRangeStart), (pinRangeEnd))
  499. #define CallWETranslateDragProc(theDrag, theItem, requestedType, putDataHere, userRoutine) \
  500.     CallUniversalProc((userRoutine), uppWETranslateDragProcInfo, (theDrag), (theItem), (requestedType), (putDataHere))
  501. #define CallWEHiliteDropAreaProc(theDrag, hiliteFlag, we, userRoutine) \
  502.     CallUniversalProc((userRoutine), uppWEHiliteDropAreaProcInfo, (theDrag), (hiliteFlag), (we))
  503. #define CallWEDrawTextProc(pText, textLength, slop, styleRunPosition, we, userRoutine) \
  504.     CallUniversalProc((userRoutine), uppWEDrawTextProcInfo, (pText), (textLength), (slop), (styleRunPosition), (we))
  505. #define CallWEPixelToCharProc(pText, textLength, slop, pixelWidth, edge, styleRunPosition, hPos, we, userRoutine) \
  506.     CallUniversalProc((userRoutine), uppWEPixelToCharProcInfo, (pText), (textLength), (slop), (pixelWidth), (edge), (styleRunPosition), (hPos), (we))
  507. #define CallWECharToPixelProc(pText, textLength, slop, offset, direction, styleRunPosition, hPos, we, userRoutine) \
  508.     CallUniversalProc((userRoutine), uppWECharToPixelProcInfo, (pText), (textLength), (slop), (offset), (direction), (styleRunPosition), (hPos), (we))
  509. #define CallWELineBreakProc(pText, textLength, textStart, textEnd, textWidth, textOffset, we, userRoutine) \
  510.     CallUniversalProc((userRoutine), uppWELineBreakProcInfo, (pText), (textLength), (textStart), (textEnd), (textWidth), (textOffset), (we))
  511. #define CallWEWordBreakProc(pText, textLength, offset, edge, breakOffsets, script, we, userRoutine) \
  512.     CallUniversalProc((userRoutine), uppWEWordBreakProcInfo, (pText), (textLength), (offset), (edge), (breakOffsets), (script), (we))
  513. #define CallWECharByteProc(pText, textOffset, script, we, userRoutine) \
  514.     CallUniversalProc((userRoutine), uppWECharByteProcInfo, (pText), (textOffset), (script), (we))
  515. #define CallWECharTypeProc(pText, textOffset, script, we, userRoutine) \
  516.     CallUniversalProc((userRoutine), uppWECharTypeProcInfo, (pText), (textOffset), (script), (we))
  517. #define CallWENewObjectProc(defaultObjectSize, obj, userRoutine) \
  518.     CallUniversalProc((userRoutine), uppWENewObjectProcInfo, (defaultObjectSize), (obj))
  519. #define CallWEDisposeObjectProc(obj, userRoutine) \
  520.     CallUniversalProc((userRoutine), uppWEDisposeObjectProcInfo, (obj))
  521. #define CallWEDrawObjectProc(destRect, obj, userRoutine) \
  522.     CallUniversalProc((userRoutine), uppWEDrawObjectProcInfo, (destRect), (obj))
  523. #define CallWEClickObjectProc(hitPt, modifiers, clickTime, obj, userRoutine) \
  524.     CallUniversalProc((userRoutine), uppWEClickObjectProcInfo, (hitPt), (modifiers), (clickTime), (obj))
  525. #define CallWEStreamObjectProc(destKind, theType, putDataHere, obj, userRoutine) \
  526.     CallUniversalProc((userRoutine), uppWEStreamObjectProcInfo, (destKind), (theType), (putDataHere), (obj))
  527.  
  528. #else
  529.  
  530. typedef WEClickLoopProcPtr WEClickLoopUPP;
  531. typedef WEScrollProcPtr WEScrollUPP;
  532. typedef WETSMPreUpdateProcPtr WETSMPreUpdateUPP;
  533. typedef WETSMPostUpdateProcPtr WETSMPostUpdateUPP;
  534. typedef WETranslateDragProcPtr WETranslateDragUPP;
  535. typedef WEHiliteDropAreaProcPtr WEHiliteDropAreaUPP;
  536. typedef WEDrawTextProcPtr WEDrawTextUPP;
  537. typedef WEPixelToCharProcPtr WEPixelToCharUPP;
  538. typedef WECharToPixelProcPtr WECharToPixelUPP;
  539. typedef WELineBreakProcPtr WELineBreakUPP;
  540. typedef WEWordBreakProcPtr WEWordBreakUPP;
  541. typedef WECharByteProcPtr WECharByteUPP;
  542. typedef WECharTypeProcPtr WECharTypeUPP;
  543. typedef WENewObjectProcPtr WENewObjectUPP;
  544. typedef WEDisposeObjectProcPtr WEDisposeObjectUPP;
  545. typedef WEDrawObjectProcPtr WEDrawObjectUPP;
  546. typedef WEClickObjectProcPtr WEClickObjectUPP;
  547. typedef WEStreamObjectProcPtr WEStreamObjectUPP;
  548.  
  549. #define NewWEClickLoopProc(userRoutine) ((WEClickLoopUPP) (userRoutine))
  550. #define NewWEScrollProc(userRoutine) ((WEScrollUPP) (userRoutine))
  551. #define NewWETSMPreUpdateProc(userRoutine) ((WETSMPreUpdateUPP) (userRoutine))
  552. #define NewWETSMPostUpdateProc(userRoutine) ((WETSMPostUpdateUPP) (userRoutine))
  553. #define NewWETranslateDragProc(userRoutine) ((WETranslateDragUPP) (userRoutine))
  554. #define NewWEHiliteDropAreaProc(userRoutine) ((WEHiliteDropAreaUPP) (userRoutine))
  555. #define NewWEDrawTextProc(userRoutine) ((WEDrawTextUPP) (userRoutine))
  556. #define NewWEPixelToCharProc(userRoutine) ((WEPixelToCharUPP) (userRoutine))
  557. #define NewWECharToPixelProc(userRoutine) ((WECharToPixelUPP) (userRoutine))
  558. #define NewWELineBreakProc(userRoutine) ((WELineBreakUPP) (userRoutine))
  559. #define NewWEWordBreakProc(userRoutine) ((WEWordBreakUPP) (userRoutine))
  560. #define NewWECharByteProc(userRoutine) ((WECharByteUPP) (userRoutine))
  561. #define NewWECharTypeProc(userRoutine) ((WECharTypeUPP) (userRoutine))
  562. #define NewWENewObjectProc(userRoutine) ((WENewObjectUPP) (userRoutine))
  563. #define NewWEDisposeObjectProc(userRoutine) ((WEDisposeObjectUPP) (userRoutine))
  564. #define NewWEDrawObjectProc(userRoutine) ((WEDrawObjectUPP) (userRoutine))
  565. #define NewWEClickObjectProc(userRoutine) ((WEClickObjectUPP) (userRoutine))
  566. #define NewWEStreamObjectProc(userRoutine) ((WEStreamObjectUPP) (userRoutine))
  567.  
  568. #define CallWEClickLoopProc(we, userRoutine) \
  569.     (*(userRoutine))((we))
  570. #define CallWEScrollProc(we, userRoutine) \
  571.     (*(userRoutine))((we))
  572. #define CallWETSMPreUpdateProc(we, userRoutine) \
  573.     (*(userRoutine))((we))
  574. #define CallWETSMPostUpdateProc(we, fixLength, inputAreaStart, inputAreaEnd, pinRangeStart, pinRangeEnd, userRoutine) \
  575.     (*(userRoutine))((we), (fixLength), (inputAreaStart), (inputAreaEnd), (pinRangeStart), (pinRangeEnd))
  576. #define CallWETranslateDragProc(theDrag, theItem, requestedType, putDataHere, userRoutine) \
  577.     (*(userRoutine))((theDrag), (theItem), (requestedType), (putDataHere))
  578. #define CallWEHiliteDropAreaProc(theDrag, hiliteFlag, hWE, userRoutine) \
  579.     (*(userRoutine))((theDrag), (hiliteFlag), (hWE))
  580. #define CallWEDrawTextProc(pText, textLength, slop, styleRunPosition, we, userRoutine) \
  581.     (*(userRoutine))((pText), (textLength), (slop), (styleRunPosition), (we))
  582. #define CallWEPixelToCharProc(pText, textLength, slop, pixelWidth, edge, styleRunPosition, hPos, we, userRoutine) \
  583.     (*(userRoutine))((pText), (textLength), (slop), (pixelWidth), (edge), (styleRunPosition), (hPos), (we))
  584. #define CallWECharToPixelProc(pText, textLength, slop, offset, direction, styleRunPosition, hPos, we, userRoutine) \
  585.     (*(userRoutine))((pText), (textLength), (slop), (offset), (direction), (styleRunPosition), (hPos), (we))
  586. #define CallWELineBreakProc(pText, textLength, textStart, textEnd, textWidth, textOffset, we, userRoutine) \
  587.     (*(userRoutine))((pText), (textLength), (textStart), (textEnd), (textWidth), (textOffset), (we))
  588. #define CallWEWordBreakProc(pText, textLength, offset, edge, breakOffsets, script, we, userRoutine) \
  589.     (*(userRoutine))((pText), (textLength), (offset), (edge), (breakOffsets), (script), (we))
  590. #define CallWECharByteProc(pText, textOffset, script, we, userRoutine) \
  591.     (*(userRoutine))((pText), (textOffset), (script), (we))
  592. #define CallWECharTypeProc(pText, textOffset, script, we, userRoutine) \
  593.     (*(userRoutine))((pText), (textOffset), (script), (we))
  594. #define CallWENewObjectProc(defaultObjectSize, obj, userRoutine) \
  595.     (*(userRoutine))((defaultObjectSize), (obj))
  596. #define CallWEDisposeObjectProc(obj, userRoutine) \
  597.     (*(userRoutine))((obj))
  598. #define CallWEDrawObjectProc(destRect, obj, userRoutine) \
  599.     (*(userRoutine))((destRect), (obj))
  600. #define CallWEClickObjectProc(hitPt, modifiers, clickTime, obj, userRoutine) \
  601.     (*(userRoutine))((hitPt), (modifiers), (clickTime), (obj))
  602. #define CallWEStreamObjectProc(destKind, theType, putDataHere, obj, userRoutine) \
  603.     (*(userRoutine))((destKind), (theType), (putDataHere), (obj))
  604.  
  605. #endif
  606.  
  607.  
  608. /*    WASTE public calls */
  609.  
  610. #ifdef __cplusplus
  611. extern "C" {
  612. #endif
  613.  
  614. /*    creation and destruction */
  615.  
  616. pascal OSErr WENew(const LongRect *destRect, const LongRect *viewRect, unsigned long flags, WEReference *we);
  617. pascal void WEDispose(WEReference we);
  618.  
  619. /*    getting variables */
  620.  
  621. pascal Handle WEGetText(WEReference we);
  622. pascal short WEGetChar(long offset, WEReference we);
  623. pascal long WEGetTextLength(WEReference we);
  624. pascal long WECountLines(WEReference we);
  625. pascal long WEGetHeight(long startLine, long endLine, WEReference we);
  626. pascal void WEGetSelection(long *selStart, long *selEnd, WEReference we);
  627. pascal void WEGetDestRect(LongRect *destRect, WEReference we);
  628. pascal void WEGetViewRect(LongRect *viewRect, WEReference we);
  629. pascal Boolean WEIsActive(WEReference we);
  630. pascal long WEOffsetToLine (long offset, WEReference we);
  631. pascal void WEGetLineRange(long lineNo, long *lineStart, long *lineEnd, WEReference we);
  632.  
  633. /*    setting variables */
  634.  
  635. pascal void WESetSelection(long selStart, long selEnd, WEReference we);
  636. pascal void WESetDestRect(const LongRect *destRect, WEReference we);
  637. pascal void WESetViewRect(const LongRect *viewRect, WEReference we);
  638.  
  639. /*    accessing style run information */
  640.  
  641. pascal Boolean WEContinuousStyle(WEStyleMode *mode, TextStyle *ts, WEReference we);
  642. pascal void WEGetRunInfo(long offset, WERunInfo *runInfo, WEReference we);
  643.  
  644. /*    converting byte offsets to screen position and vice versa */
  645.  
  646. pascal long WEGetOffset(const LongPt *thePoint, char *edge, WEReference we);
  647. pascal void WEGetPoint(long offset, LongPt *thePoint, short *lineHeight, WEReference we);
  648.  
  649. /*    finding words and lines */
  650.  
  651. pascal void WEFindWord(long offset, char edge, long *wordStart, long *wordEnd, WEReference we);
  652. pascal void WEFindLine(long offset, char edge, long *lineStart, long *lineEnd, WEReference we);
  653.  
  654. /*    making a copy of a text range */
  655.  
  656. pascal OSErr WECopyRange(long rangeStart, long rangeEnd, Handle hText, StScrpHandle hStyles, WESoupHandle hSoup, WEReference we);
  657.  
  658. /*    getting and setting the alignment style */
  659.  
  660. pascal WEAlignment WEGetAlignment(WEReference we);
  661. pascal void WESetAlignment(WEAlignment alignment, WEReference we);
  662.  
  663. /*    recalculating line breaks, drawing and scrolling */
  664.  
  665. pascal OSErr WECalText(WEReference we);
  666. pascal void WEUpdate(RgnHandle updateRgn, WEReference we);
  667. pascal void WEScroll(long hOffset, long vOffset, WEReference we);
  668. pascal void WESelView(WEReference we);
  669.  
  670. /*    handling activate / deactivate events */
  671.  
  672. pascal void WEActivate(WEReference we);
  673. pascal void WEDeactivate(WEReference we);
  674.  
  675. /*     handling key-down events */
  676.  
  677. pascal void WEKey(short key, EventModifiers modifiers, WEReference we);
  678.  
  679. /*    handling mouse-down events and mouse tracking */
  680.  
  681. pascal void WEClick(Point hitPt, EventModifiers modifiers, unsigned long clickTime, WEReference we);
  682.  
  683. /*    adjusting the cursor shape */
  684.  
  685. pascal Boolean WEAdjustCursor(Point mouseLoc, RgnHandle mouseRgn, WEReference we);
  686.  
  687. /*    blinking the caret */
  688.  
  689. pascal void WEIdle(unsigned long *maxSleep, WEReference we);
  690.  
  691. /*    modifying the text and the styles */
  692.  
  693. pascal OSErr WEInsert(const void *pText, long textLength, StScrpHandle hStyles, WESoupHandle hSoup, WEReference we);
  694. pascal OSErr WEDelete(WEReference we);
  695. pascal OSErr WESetStyle(WEStyleMode mode, const TextStyle *ts, WEReference we);
  696. pascal OSErr WEUseStyleScrap(StScrpHandle hStyles, WEReference we);
  697. pascal OSErr WEUseText(Handle hText, WEReference we);
  698.  
  699. /*    undo */
  700.  
  701. pascal OSErr WEUndo(WEReference we);
  702. pascal void WEClearUndo(WEReference we);
  703. pascal WEActionKind WEGetUndoInfo(Boolean *redoFlag, WEReference we);
  704. pascal Boolean WEIsTyping(WEReference we);
  705.  
  706. /*    keeping track of changes */
  707.  
  708. pascal unsigned long WEGetModCount(WEReference we);
  709. pascal void WEResetModCount(WEReference we);
  710.  
  711. /*    embedded objects */
  712.  
  713. pascal OSErr WEInstallObjectHandler(FlavorType objectType, WESelector handlerSelector, UniversalProcPtr handler, WEReference we);
  714. pascal OSErr WEGetObjectHandler(FlavorType objectType, WESelector handlerSelector, UniversalProcPtr *handler, WEReference we);
  715. pascal OSErr WEInsertObject(FlavorType objectType, Handle objectDataHandle, Point objectSize, WEReference we);
  716. pascal OSErr WEGetSelectedObject(WEObjectReference *obj, WEReference we);
  717. pascal long WEFindNextObject(long offset, WEObjectReference *obj, WEReference we);
  718. pascal OSErr WEUseSoup(WESoupHandle hSoup, WEReference we);
  719.  
  720. /*    accessing embedded object attributes */
  721.  
  722. pascal FlavorType WEGetObjectType(WEObjectReference obj);
  723. pascal Handle WEGetObjectDataHandle(WEObjectReference obj);
  724. pascal Point WEGetObjectSize(WEObjectReference obj);
  725. pascal WEReference WEGetObjectOwner(WEObjectReference obj);
  726. pascal long WEGetObjectRefCon(WEObjectReference obj);
  727. pascal void WESetObjectRefCon(WEObjectReference obj, long refCon);
  728.  
  729. /*    clipboard operations */
  730.  
  731. pascal OSErr WECut(WEReference we);
  732. pascal OSErr WECopy(WEReference we);
  733. pascal OSErr WEPaste(WEReference we);
  734. pascal Boolean WECanPaste(WEReference we);
  735.  
  736. /*    Drag Manager support */
  737.  
  738. pascal RgnHandle WEGetHiliteRgn(long rangeStart, long rangeEnd, WEReference we);
  739. pascal OSErr WETrackDrag(DragTrackingMessage message, DragReference drag, WEReference we);
  740. pascal OSErr WEReceiveDrag(DragReference drag, WEReference we);
  741. pascal Boolean WECanAcceptDrag(DragReference drag, WEReference we);
  742. pascal Boolean WEDraggedToTrash(DragReference drag);
  743.  
  744. /*    Script Manager utilities */
  745.  
  746. pascal short WECharByte(long offset, WEReference we);
  747. pascal short WECharType(long offset, WEReference we);
  748.  
  749. /*    Text Services Manager support */
  750.  
  751. pascal OSErr WEInstallTSMHandlers(void);
  752. pascal OSErr WERemoveTSMHandlers(void);
  753. pascal void WEStopInlineSession(WEReference we);
  754.  
  755. /*    additional features */
  756.  
  757. pascal short WEFeatureFlag(short feature, short action, WEReference we);
  758. pascal OSErr WEGetInfo(WESelector selector, void *info, WEReference we);
  759. pascal OSErr WESetInfo(WESelector selector, const void *info, WEReference we);
  760.  
  761. /*    long coordinate utilities */
  762.  
  763. pascal void WELongPointToPoint(const LongPt *lp, Point *p);
  764. pascal void WEPointToLongPoint(Point p, LongPt *lp);
  765. pascal void WESetLongRect(LongRect *lr, long left, long top, long right, long bottom);
  766. pascal void WELongRectToRect(const LongRect *lr, Rect *r);
  767. pascal void WERectToLongRect(const Rect *r, LongRect *lr);
  768. pascal void WEOffsetLongRect(LongRect *lr, long hOffset, long vOffset);
  769. pascal Boolean WELongPointInLongRect(const LongPt *lp, const LongRect *lr);
  770.  
  771. #ifdef __cplusplus
  772. }
  773. #endif
  774.  
  775. #if defined(powerc) || defined (__powerc)
  776. #pragma options align=reset
  777. #endif
  778.  
  779. #endif
  780.